1. Field of the Invention
The present invention relates to printers, and more particularly relates to a printer, which is connected to a plurality of hosts through a plurality of bidirectional interfaces, for selectively using one of the interfaces to receive print data from the hosts and to print the data on paper, a control method for the printer, and a computer-readable storage medium for storing a control program for the printer.
2. Description of the Related Art
In general, a conventional printer which is connected through the Centronics interface to a host such as a personal computer receives a device ID request from the host in accordance with a protocol in conformity with the IEEE (Institute of Electrical and Electronics Engineers) P1284 standard. In response to this, the printer transmits device ID information thereof (the manufacturer name, model number, etc.) and state information thereof (printing, out of paper, paper jam, etc.) to the host. A printer driver in the host transmits the device ID request prior to transmitting print data to the printer, so that the host can determine whether the printer is available for printing data based on a response from the printer. When the host determines that the printer is available, the host transmits print data. If necessary, the host transmits a device ID request to the printer even when the host will not transmit print data. In doing so, the host can determine the state of the printer.
Concerning the above-described type of printer, there is one type of printer which is connected to a plurality of hosts through a plurality of Centronics interfaces. By switching and selectively using one of the interfaces, a single printing device can receive print data from a plurality of hosts and print the data on paper.
Such a conventional printer with the above arrangement receives device ID requests from a plurality of hosts through a plurality of interfaces at arbitrary times. Even when the printer is printing print data from one host, the printer is configured to receive a device ID request from another host. When the printer receives a device ID request through each interface, the printer always transmits a response to the request through the interface.
In the printer having a plurality of interfaces, there is only one receive buffer for storing print data received from the host. It is impossible to simultaneously receive a plurality of pieces of print data through a plurality of interfaces. As a result, the following problems occur.
Specifically, a printer driver in host A sends a device ID request to the printer through one interface and subsequently receives the device ID and state information indicating that the printer is available to receive and print data. Within the short period of time from reception of the information by the printer driver in host A to transmission of print data to the printer, a printer driver in host B sends a device ID request to the printer through another interface in order to print data.
Before receiving the print data from host A, the printer is not in a busy state. Specifically, in the busy state, the interface connected to host A is busy, and the printer is permitted to receive print data only using this interface. Since the printer is not in the busy state, the printer transmits the device ID and information indicating that the printer is available to receive and print data to host B.
Immediately after this, the printer driver in host A transmits the print data to the printer. While receiving the print data, the printer enters the busy state in which the printer is monopolized by host A connected to the busy interface. This state differs from that indicated by the information obtained by the printer driver in host B from the printer in response to the device ID request. When the printer driver in host B tries to transmit the print data to the printer through an operation system (OS), the printer cannot receive the data. Due to the incapability of the host and the complexity of the OS, it requires tens of seconds for the printer driver in host B to receive information indicating that the printer cannot receive print data from the OS. Specifically, tens of seconds are necessary to report that the actual state of the printer at the present moment differs from the state of the printer based on the information obtained in response to the device ID request. When the printer driver in host B receives the printer state information in response to the device ID request, and when the state of the printer is displayed on a display of host B based on the printer state information, the state which differs from the actual state of the printer at the present moment is displayed for tens of seconds.